package com.itheima.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.server.domain.CluBusSave;
import com.itheima.server.mapper.RuleMapper;
import com.itheima.server.service.RuleService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@RequiredArgsConstructor
public class RuleServiceImpl extends ServiceImpl<RuleMapper, CluBusSave> implements RuleService {
    private final RuleMapper ruleMapper;

    @Override
    public CluBusSave getDisposition(Integer type) {
        CluBusSave cluBusSave = super.getOne(Wrappers.<CluBusSave>lambdaQuery()
                .eq(CluBusSave::getType, type));
        return cluBusSave;
    }
}
